package com.study.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName grades
 */
@TableName(value ="grades")
@Data
public class Grades implements Serializable {
    /**
     * 
     */
    @TableId(value = "grade_id", type = IdType.AUTO)
    private Integer grade_id;

    /**
     * 
     */
    @TableField(value = "student_id")
    private Integer student_id;

    /**
     * 
     */
    @TableField(value = "course_id")
    private Integer course_id;

    /**
     * 
     */
    @TableField(value = "score")
    private BigDecimal score;

    /**
     * 
     */
    @TableField(value = "exam_type")
    private Object exam_type;

    /**
     * 
     */
    @TableField(value = "exam_date")
    private Date exam_date;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Grades other = (Grades) that;
        return (this.getGrade_id() == null ? other.getGrade_id() == null : this.getGrade_id().equals(other.getGrade_id()))
            && (this.getStudent_id() == null ? other.getStudent_id() == null : this.getStudent_id().equals(other.getStudent_id()))
            && (this.getCourse_id() == null ? other.getCourse_id() == null : this.getCourse_id().equals(other.getCourse_id()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getExam_type() == null ? other.getExam_type() == null : this.getExam_type().equals(other.getExam_type()))
            && (this.getExam_date() == null ? other.getExam_date() == null : this.getExam_date().equals(other.getExam_date()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getGrade_id() == null) ? 0 : getGrade_id().hashCode());
        result = prime * result + ((getStudent_id() == null) ? 0 : getStudent_id().hashCode());
        result = prime * result + ((getCourse_id() == null) ? 0 : getCourse_id().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getExam_type() == null) ? 0 : getExam_type().hashCode());
        result = prime * result + ((getExam_date() == null) ? 0 : getExam_date().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", grade_id=").append(grade_id);
        sb.append(", student_id=").append(student_id);
        sb.append(", course_id=").append(course_id);
        sb.append(", score=").append(score);
        sb.append(", exam_type=").append(exam_type);
        sb.append(", exam_date=").append(exam_date);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}